{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "0c82ff34-3956-4cc4-bb20-afc9f40a8e6e",
   "metadata": {},
   "source": [
    "# 一、6中最基本的创建方法"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b7dbe70d-42f8-4884-9753-9aa29f00fd5d",
   "metadata": {},
   "source": [
    "## （1）empty"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "73fa8ec3-d463-4c5c-8366-4f95eebcd128",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "2ce8b1da-9431-41be-849b-1a9196632b73",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0., 0.],\n",
       "       [0., 0., 0.]])"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.empty(shape=(2, 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "30ca5a86-4725-4d37-94c3-55f560d6eb92",
   "metadata": {},
   "source": [
    "## （2）zeros"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "d9353030-6f7c-4554-ab9d-23ad592f6e5f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0., 0., 0.])"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros(shape=(3,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "32cd9390-ba55-4f18-a3fb-61af7cffa98d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0., 0.],\n",
       "       [0., 0., 0.]])"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros(shape=(2, 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "8e75efab-a277-4795-a5f1-dd39342b9f2e",
   "metadata": {},
   "source": [
    "## （3）ones"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "cf1f64b4-c451-4579-b189-5c4ad7d3ba94",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1., 1.])"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones(shape=(2,))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "b16bfbbc-595a-432e-ba17-4deb51131e73",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 1.],\n",
       "       [1., 1.],\n",
       "       [1., 1.]])"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones(shape=(3, 2))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e4a30387-de0b-469c-8b8b-0b1f5257a7c2",
   "metadata": {},
   "source": [
    "## （4）full"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "ffd49807-a40b-4ca8-bf4f-b59207e9fb9f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[8, 8, 8],\n",
       "       [8, 8, 8]])"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.full(shape=(2, 3), fill_value=8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6de0a2dd-2888-43db-a63f-bb39348094eb",
   "metadata": {},
   "source": [
    "## （5）array"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "f312fd77-a2bb-43f3-9544-d2719f5b227f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 1, 1])"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lst = [1, 1, 1]\n",
    "np.array(lst)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9c04a551-4cc1-4420-83d6-532343a96b02",
   "metadata": {},
   "source": [
    "## （6）eye"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "2ffea971-fda0-42a7-980a-9f26d7c3cfd9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 0., 0., 0., 0.],\n",
       "       [0., 1., 0., 0., 0.],\n",
       "       [0., 0., 1., 0., 0.],\n",
       "       [0., 0., 0., 1., 0.],\n",
       "       [0., 0., 0., 0., 1.]])"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.eye(5)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "8497ed3f-3aa0-4e14-9d0c-1d4f67530179",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 1., 0., 0.],\n",
       "       [0., 0., 1., 0.],\n",
       "       [0., 0., 0., 1.],\n",
       "       [0., 0., 0., 0.]])"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.eye(4, k=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "8fcc5c6c-aee7-4274-b508-e5fe3b0d648b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0., 0., 0.],\n",
       "       [1., 0., 0., 0.],\n",
       "       [0., 1., 0., 0.],\n",
       "       [0., 0., 1., 0.]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.eye(4, k=-1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "3785a035-dd15-4ceb-abcc-23895ce8b761",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 0., 0., 0.],\n",
       "       [0., 1., 0., 0.],\n",
       "       [0., 0., 1., 0.],\n",
       "       [0., 0., 0., 1.]])"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.eye(4, k=0)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f0c7141c-b5e1-4ce1-9a7b-d83269251967",
   "metadata": {},
   "source": [
    "# 二、3种通过范围创建的方法"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e20b467f-fe79-47fe-84a4-862b101df1a7",
   "metadata": {},
   "source": [
    "## （1）arange"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "cca80359-f9b9-47d8-a081-aa912eca8302",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1,  2,  3,  4,  5,  6,  7,  8,  9, 10])"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange(1, 11)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "a99fff4b-07e8-436f-99b9-846b706a51ef",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10])"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange(11)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "e9338b47-f223-4261-a07e-be9272ffcdaf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([1, 3, 5, 7, 9])"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.arange(1, 11, 2)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2c85bed7-f15e-498d-bab5-a1b4865830f8",
   "metadata": {},
   "source": [
    "## （2）linsapce"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "2c0927ae-2d04-4ce6-88b7-ba1d27f6bca3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  3.,  5.,  7.,  9., 11., 13., 15., 17., 19.])"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linspace(1, 19, num=10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "4711f715-90f1-45a6-903e-3700ab0ec60c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([ 1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9., 10., 11., 12., 13.,\n",
       "       14., 15., 16., 17., 18., 19.])"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.linspace(1, 19, num=19)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3cb19ea-27a1-400b-a3fe-4913130800d9",
   "metadata": {},
   "source": [
    "## （3）logspace"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "14f3a831-9710-474c-923c-3c58b669fb31",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  4.,  16.,  64., 256.])"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.logspace(2, 8, base=2, num=4)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "id": "989f05f2-a86e-48aa-bd1a-da92427c10ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([   1,    2,    4,    8,   16,   32,   64,  128,  256,  512, 1024])"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.logspace(0, 10, num=11, base=2, dtype=int)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "88ac71b1-595e-4da7-9ab5-7ad35b9700e7",
   "metadata": {},
   "source": [
    "# 三、4中随机生成的方式"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0705b191-0496-4b66-b1fb-67de1eabc097",
   "metadata": {},
   "source": [
    "## （1）rand"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "5d04098b-173a-43a7-aeee-f61effb42f5f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.34270701, 0.13467236, 0.45460325],\n",
       "       [0.51496619, 0.39973861, 0.5729118 ],\n",
       "       [0.52779683, 0.90840043, 0.08871997]])"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.rand(3, 3)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "78d0fe8d-a86f-488b-877b-a4633d370471",
   "metadata": {},
   "source": [
    "## （2）randn"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "15ca65a0-0fe9-4dd8-b173-478b070865fc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 0.07315001,  0.80028664,  0.19244546, -0.28408192, -0.23897185],\n",
       "       [-1.0970856 ,  1.48867725, -2.79308858,  0.48034065,  0.62723371],\n",
       "       [-0.07379156,  0.61298222,  0.52784304, -0.19592331,  0.2321213 ],\n",
       "       [-0.24392743,  0.4677731 , -1.64555166, -0.45679299, -1.06506111],\n",
       "       [-0.49912153,  1.06456203, -0.01387959, -0.57595415, -0.58506822]])"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.randn(5, 5)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "397346d6-75d8-4f1f-a386-88cb593ae44b",
   "metadata": {},
   "source": [
    "## （3）randint"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "10271ee8-7d51-412f-975e-c0237d8cf5f3",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[ 8, 10,  9],\n",
       "       [ 3,  3,  2],\n",
       "       [ 4,  9,  7]], dtype=int32)"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.randint(1, 11, size=(3, 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "73b92b29-9f20-4ceb-aab5-0f55b1666ef3",
   "metadata": {},
   "source": [
    "## （4）normal"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "id": "16b0de4a-715e-42f5-a7ad-1af82915cd57",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[[ 0.3946823 ,  1.18934975,  0.9291635 ],\n",
       "        [-1.62439139,  0.53497976, -0.35234597],\n",
       "        [-0.42947304,  0.34978586, -0.8102876 ]],\n",
       "\n",
       "       [[ 1.86342537,  0.41018708,  1.09204911],\n",
       "        [-0.72827988, -0.88689   ,  0.24473168],\n",
       "        [ 0.03430608,  1.45684723,  1.28796441]],\n",
       "\n",
       "       [[-1.19211727,  0.71226433, -0.52627647],\n",
       "        [-1.25796439,  2.19334916,  0.0382626 ],\n",
       "        [-0.78285571,  1.02851523,  1.33544057]]])"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.random.normal(loc=0.0, scale=1.0, size=(3, 3, 3))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d1482990-c9a2-43a7-a298-7b9c23684ee7",
   "metadata": {},
   "source": [
    "# 四、7中通过已有的数据创建"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b3f1b9f2-d6cf-4ef7-ad05-32558c2845d6",
   "metadata": {},
   "source": [
    "## （1）asarray"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "137ad8f7-2c13-4a66-88e6-670216febb39",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.98459896, -0.38580305,  0.820078  ],\n",
       "       [-1.10958052, -1.25578774,  0.71605666],\n",
       "       [ 0.39373062,  0.01683385, -0.66811838]])"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a = np.random.randn(3, 3)\n",
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "25c91bea-4dd6-4de0-a466-a6562f2718bc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.98459896, -0.38580305,  0.820078  ],\n",
       "       [-1.10958052, -1.25578774,  0.71605666],\n",
       "       [ 0.39373062,  0.01683385, -0.66811838]])"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.asarray(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3786990c-3b2c-4a9d-90fe-e2dbfde620ee",
   "metadata": {},
   "source": [
    "## （2）frombuffer"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "ddd7dacb-675d-4a02-b91f-4c260c80afdf",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([b'x', b'i', b'a', b'o', b'd', b'a', b'i', b'1', b'1', b'1', b'1',\n",
       "       b'1'], dtype='|S1')"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.frombuffer(b'xiaodai11111', dtype='S1')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "e6942078-0bc0-4e92-b112-5aa5a87d7304",
   "metadata": {},
   "source": [
    "## （3）fromiter"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "id": "344172a7-8d50-49ae-823b-80f09b215000",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.fromiter(range(10), dtype='int')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d061ce2b-ce29-402f-81ec-bfdc4a65823b",
   "metadata": {},
   "source": [
    "## （4）empty_like"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "9fb0f875-0086-431f-bda9-0f5ee3538062",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.98459896, -0.38580305,  0.820078  ],\n",
       "       [-1.10958052, -1.25578774,  0.71605666],\n",
       "       [ 0.39373062,  0.01683385, -0.66811838]])"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "adb06d76-293e-49e1-8e1b-78b0d1d2be04",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0.98459896, 0.38580305, 0.820078  ],\n",
       "       [1.10958052, 1.25578774, 0.71605666],\n",
       "       [0.39373062, 0.01683385, 0.66811838]])"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.empty_like(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ad72ef44-f05d-444a-8c3c-9078c5795abc",
   "metadata": {},
   "source": [
    "## （5）zeros_like"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "42ed9d29-7465-4322-953d-8f1fad7a0bc8",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[0., 0., 0.],\n",
       "       [0., 0., 0.],\n",
       "       [0., 0., 0.]])"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.zeros_like(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6a22f1d1-31b3-495c-803d-cef3ce740e6d",
   "metadata": {},
   "source": [
    "## （6）ones_like"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "c91580bf-8012-4bfc-9f47-58531617a815",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[1., 1., 1.],\n",
       "       [1., 1., 1.],\n",
       "       [1., 1., 1.]])"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.ones_like(a)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "89cb1617-0d2b-49a6-91bd-2c0a4930baad",
   "metadata": {},
   "source": [
    "## （7）full_like"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "id": "120640da-ebee-4063-8764-4afd683cd021",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[8., 8., 8.],\n",
       "       [8., 8., 8.],\n",
       "       [8., 8., 8.]])"
      ]
     },
     "execution_count": 35,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "np.full_like(a, fill_value=8)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c16a5283-05e0-4194-9300-b2779ed757ef",
   "metadata": {},
   "source": [
    "# 五、4个多维数组属性"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4c45827b-9e83-4deb-9c71-f2d6f3a0a530",
   "metadata": {},
   "source": [
    "## （1）ndim"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "id": "f1586db3-7583-4072-beba-b2cab0d4e49f",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.ndim"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a3588f06-d5f1-4718-a03f-6e6f45e5b25a",
   "metadata": {},
   "source": [
    "## （2）shape"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "id": "ce2e67d6-54e3-4d35-97d0-1f2cd96ab3c6",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, 3)"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.shape"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d6e881ed-1bbc-4d86-a999-8933001d811a",
   "metadata": {},
   "source": [
    "## （3）dtype"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "id": "08b44e07-a95f-497e-b38b-b55d2866fcdc",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "dtype('float64')"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.dtype"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2f43122f-53bb-4c84-ac05-934c03ec2f74",
   "metadata": {},
   "source": [
    "## （4）size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "aecedec2-3447-4480-bbfc-e13a01e55296",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "9"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "a.size"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "41bcdc91-bf86-4179-8afa-e775bdde98cd",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
